'\" te
.\"  Copyright 1989 AT&T  Copyright (c) 1997 Sun Microsystems, Inc.  All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH GETDEV 8 "Jul 5, 1990"
.SH NAME
getdev \- lists devices based on criteria
.SH SYNOPSIS
.LP
.nf
\fBgetdev\fR [\fB-ae\fR] [\fIcriteria\fR]... [\fIdevice\fR]...
.fi

.SH DESCRIPTION
.sp
.LP
\fBgetdev\fR generates a list of devices that match certain criteria. The
criteria includes a list of attributes (given in expressions) and a list of
devices. If no  criteria are given, all devices are included in the list.
.sp
.LP
Devices must satisfy at least one of the criteria in the list unless the
\fB-a\fR option is used. Then, only those devices which match all of the
criteria in a list will be included.
.sp
.LP
Devices which are defined on the command line and which match the criteria are
included in the generated list. However, if the \fB-e\fR option is used, the
list becomes a set of devices to be \fIexcluded\fR from the list. See
\fBOPTIONS\fR and  \fBOPERANDS\fR.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 6n
Specifies that a device must match all criteria to be included in the list
generated by this command. The option has no effect if no criteria are defined.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR\fR
.ad
.RS 6n
Specifies that the list of devices which follows on the command line should be
\fIexcluded\fR from the list generated by this command. Without the \fB-e\fR
the named devices are \fIincluded\fR in the generated list. The flag has no
effect if no devices are defined.
.RE

.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIcriteria\fR\fR
.ad
.RS 12n
Defines the criteria that a device must match to be included in the generated
list. \fIcriteria\fR is specified by expressions.
.sp
There are four possible expression types which the criteria specified in the
\fIcriteria\fR argument may follow:
.sp
.ne 2
.na
\fB\fIattribute\fR\fB=\fR\fIvalue\fR\fR
.ad
.RS 20n
Selects all devices whose attribute \fIattribute\fR is defined and is equal to
\fIvalue\fR.
.RE

.sp
.ne 2
.na
\fB\fIattribute\fR\fB!=\fR\fIvalue\fR\fR
.ad
.RS 20n
Selects all devices whose attribute \fIattribute\fR is defined and does not
equal \fIvalue\fR.
.RE

.sp
.ne 2
.na
\fB\fIattribute\fR\fB:*\fR\fR
.ad
.RS 20n
Selects all devices which have the attribute \fIattribute\fR defined.
.RE

.sp
.ne 2
.na
\fB\fIattribute\fR\fB!:*\fR\fR
.ad
.RS 20n
Selects all devices which do not have the attribute \fIattribute\fR defined.
.RE

See the \fBputdev\fR(8) manual page for a complete listing and description of
available attributes.
.RE

.sp
.ne 2
.na
\fB\fIdevice\fR\fR
.ad
.RS 12n
Defines the devices which should be included in the generated list. This can be
the pathname of the device or the device alias.
.RE

.SH EXIT STATUS
.sp
.LP
The  following  exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
Command syntax was incorrect, invalid option was used, or an internal error
occurred.
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 5n
Device table could not be opened for reading.
.RE

.SH FILES
.sp
.ne 2
.na
\fB\fB/etc/device.tab\fR\fR
.ad
.RS 19n

.RE

.SH SEE ALSO
.sp
.LP
.BR attributes (7),
.BR devattr (8),
.BR getdgrp (8),
.BR putdev (8),
.BR putdgrp (8)
